<?php
define('EmpireCMSAdmin','1');
define('EmpireCMSAPage','login');
define('EmpireCMSNFPage','1');
require("../class/connect.php");
require("../class/functions.php");
//风格
$loginadminstyleid=EcmsReturnAdminStyle();
//变量处理
$empirecmskey1='';
$empirecmskey2='';
$empirecmskey3='';
$empirecmskey4='';
$empirecmskey5='';
if($_POST['empirecmskey1']&&$_POST['empirecmskey2']&&$_POST['empirecmskey3']&&$_POST['empirecmskey4']&&$_POST['empirecmskey5'])
{
	$empirecmskey1=RepPostVar($_POST['empirecmskey1']);
	$empirecmskey2=RepPostVar($_POST['empirecmskey2']);
	$empirecmskey3=RepPostVar($_POST['empirecmskey3']);
	$empirecmskey4=RepPostVar($_POST['empirecmskey4']);
	$empirecmskey5=RepPostVar($_POST['empirecmskey5']);
	$ecertkeyrndstr=$empirecmskey1.'#!#'.$empirecmskey2.'#!#'.$empirecmskey3.'#!#'.$empirecmskey4.'#!#'.$empirecmskey5;
	esetcookie('ecertkeyrnds',$ecertkeyrndstr,0);
}
elseif(getcvar('ecertkeyrnds'))
{
	$certr=explode('#!#',getcvar('ecertkeyrnds'));
	$empirecmskey1=RepPostVar($certr[0]);
	$empirecmskey2=RepPostVar($certr[1]);
	$empirecmskey3=RepPostVar($certr[2]);
	$empirecmskey4=RepPostVar($certr[3]);
	$empirecmskey5=RepPostVar($certr[4]);
}
else
{}


?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>后台管理</title>
<link rel="stylesheet" href="loginimg/css/global.css" type="text/css">
<script>
if(self!=top)
{
	parent.location.href='index.php';
}
function CheckLogin(obj){
	if(obj.username.value=='')
	{
		alert('请输入用户名');
		obj.username.focus();
		return false;
	}
	if(obj.password.value=='')
	{
		alert('请输入登录密码');
		obj.password.focus();
		return false;
	}
	if(obj.loginauth!=null)
	{
		if(obj.loginauth.value=='')
		{
			alert('请输入认证码');
			obj.loginauth.focus();
			return false;
		}
	}
	if(obj.key!=null)
	{
		if(obj.key.value=='')
		{
			alert('请输入验证码');
			obj.key.focus();
			return false;
		}
	}
	return true;
}
</script>
</head>

<body onload="document.login.username.focus();">

    <!--头部-->
   
	<div class="loginbox">
		<!--<div class="siteName"><span>PC/WAP端</span></div>-->
      
            <!--登录信息-->
		<div class="userlogin">
			<form name="login" id="login" method="post" action="ecmsadmin.php" onSubmit="return CheckLogin(document.login);">    
			<input type="hidden" name="enews" value="login">            
				<div class="input-username row"><span>用&nbsp;&nbsp;户</span><input name="username" id="username" size="28" maxlength="40" value="请输入您的用户名" onFocus="javascript:if(this.value == &quot;请输入您的用户名&quot;){this.value = &quot;&quot;;this.style.color = &quot;#A9A9A9&quot;;}" onBlur="javascript:if(this.value == &quot;&quot;){this.value = &quot;请输入您的用户名&quot;;this.style.color = &quot;&quot;;}"></div>
				<div class="input-password row"><span>密&nbsp;&nbsp;码</span><input name="password" type="password" id="password" size="28" maxlength="40" placeholder="请输入您的密码"></div>
			  <?php
			  if($ecms_config['esafe']['loginauth'])//判断认证码是否开启
			  {
			  ?>
				<div class="input-loginauth row"><span>认证码</span><input name="loginauth" type="password" id="loginauth" size="28" maxlength="40" placeholder="请输入网站认证码" ></div>
			  <?php
			  }
			  ?>
			 
			  <?php
			  if(empty($public_r['adminloginkey']))//判断验证码是否开启
			  {
			  ?>
				 <div class="input-key row"><span>验证码</span><input name="key" type="text"  size="18" id="loginkey-inp">&nbsp;&nbsp;<img src="ShowKey.php" name="KeyImg" id="KeyImg" align="middle" onClick="KeyImg.src='ShowKey.php?'+Math.random()" alt="看不清楚,点击刷新"></div>
			  <?php
			  }
			  ?>
				<!--按钮-->
				<div class="bnt">
					<input name="submit" type="submit" class="Signin" value="登录">
					<input name="reset" type="reset" class="Clean" value="重输">
				</div>
			</form>   
		</div>
		<div class="footer">
			<p>Wujh QQ:289770732 Tel:18108037832 <a href="/">index</a></p>
		</div>
                   
	</div>
	<!--底部-->
	


<script>
if(document.login.equestion.value==0)
{
	showanswer.style.display='none';
}
</script>
</body>
</html>